package dk.au.cs.peterbn.patterns;

import java.util.Collection;

/**
 * Design pattern descriptor.
 */
public interface DesignPattern extends HasDescription{

    /**
     * @return the canonical types that are part of this pattern
     */
    abstract Collection<TypeRole> getTypes();


    /**
     * This method is meant to return a description of the design pattern
     * that would be fit for including in the javadoc of an annotated class.
     * That means that it shouldn't be too long.
     * It may contain any html-markup.
     * @return Description of pattern
     */
    abstract String getDescription();

    /**
     * The name of the design pattern
     *
     * This name is intended to be unique within the group
     * @return The canonical pattern name.
     */
    String getName();

    /**
     * The group of the design pattern.
     * This is a reference to the pattern collection where this particular pattern is described.
     * An example would be <code>gof</code> for the Gang of four book <em>Design Patterns</em>
     * @return The pattern group
     */
    String getGroup();

    /**
     * Look up a member role by it's name. Event names are unique.
     * @param name The name to look for
     * @return The desired MemberRole or <code>null</code> if no role with that name exists in the pattern.
     */
    MemberRole getMember(String name);

    /**
     * Look up TypeRoles by their name.
     * TypeRole names are unique identifiers in a pattern
     * @param name The TypeRole name to look for
     * @return The desired TypeRole or <code>null</code> if no TypeRole with that name exists in the pattern.
     */
    TypeRole getTypeRole(String name);
    /**
     * Get the name of the pattern variation in use.
     * @return The name of the pattern variation or <code>null</code> if no variation is used
     */
    String getVariation();

    /**
     * Get the identifier for this pattern instance
     * @return The identifier for this pattern
     */
    String getIdentifier();
}
